<script>
function state(statename,stateid,getid) //参数,状态名称,内容ID,状态值
{
$.ajax({
  type: 'POST',
  url: '__URL__/state-'+statename+'-'+stateid+'-'+getid,
  dataType: "json",
  success: function(json) {
	  if(json.result==1){//成功
	  
	  parent.asyncbox.success(json.msg,'{lang='操作提示'}',function(buttonResult){				
		  if(getid==1){
		  $('#'+statename+'_'+stateid).removeClass("nature_f").addClass ("nature_t"); //修改样式
		  $('#'+statename+'_'+stateid).attr("href", "javascript:state('"+statename+"','"+stateid+"','0')"); 
		  }else{
		  $('#'+statename+'_'+stateid).removeClass("nature_t").addClass ("nature_f");
		  $('#'+statename+'_'+stateid).attr("href", "javascript:state('"+statename+"','"+stateid+"','1')"); 
		  }				
			});
	  
	  }else{
		  parent.asyncbox.success('{lang='修改失败'}','{lang='操作提示'}',function(buttonResult){});
	  }
	  }
	});
}
</script>

<script language="javascript">
function selectAll(name){   
    $("[name='"+name+"']").each(function(){//反选   
    if($(this).attr("checked")){   
          $(this).removeAttr("checked");   
    }else{   
          $(this).attr("checked",'true');   
    }   
    })  
}
</script>

<script type="text/javascript">
//批量操作
function on_change(){
  var temp = document.getElementById("mode").value;
  if(temp == 4){
  document.getElementById("schange").style.display="block";
  }else{
  document.getElementById("schange").style.display="none";
  }
  }
</script> 

<script language="javascript">
//删除
function dellist(id) {
	parent.asyncbox.confirm('{lang='确认删除？删除后不可恢复！'}', '{lang='操作提示'}',
	function(action) {　　　　
	if (action == 'ok') {
	$.ajax({
	type: 'POST',
	url: '__URL__/del-' + id
	});
	$('#del_' + id).remove();　　
	}	　　
	});
}
</script> 